<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');

$ydata1 = array(11,3,8,12,5,1,9,13,5,7,54,67);
$ydata2 = array(354,200,265,99,111,91,198,225,293,251,98,106);
$ydata3 = array(35,100,10,90,10,20,30,40,50,60,70,23);
$ydata4 = array(35,10,120,112,10,12,13,40,50,60,11,43);
$ydata5 = array(63,40,12,122,40,50,60,99,77,66,34,89);

// Create the graph and specify the scale for both Y-axis
$graph = new Graph(600,300);
$graph->SetScale("textlin");
$graph->SetY2Scale("lin");
$graph->SetShadow();
$graph->title->Set("Reservation Lab room");
$graph->subtitle->Set("line chart(month)");

// Adjust the margin
$graph->img->SetMargin(40,40,20,70);

// Create the 5 linear plot
$lineplot1=new LinePlot($ydata1);
$lineplot2=new LinePlot($ydata2);
$lineplot3=new LinePlot($ydata3);
$lineplot4=new LinePlot($ydata4);
$lineplot5=new LinePlot($ydata5);

// Add the plot to the graph
$graph->Add($lineplot1);
$graph->AddY2($lineplot2);
$graph->AddY2($lineplot3);
$graph->AddY2($lineplot4);
$graph->AddY2($lineplot5);

// Adjust the axis color
$graph->y2axis->SetColor("orange");
$graph->yaxis->SetColor("blue");


$graph->xaxis->title->Set("month");
$graph->yaxis->title->Set("reservation");
 
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);

// Set the colors for the plots
$lineplot1->SetColor("blue");
$lineplot1->SetWeight(2);
$lineplot2->SetColor("orange");
$lineplot2->SetWeight(2);
$lineplot3->SetColor("brown");
$lineplot3->SetWeight(2);
$lineplot4->SetColor("pink");
$lineplot4->SetWeight(2);
$lineplot5->SetColor("yellow");
$lineplot5->SetWeight(2);

// Set the legends for the plots
$lineplot1->SetLegend("1201A");
$lineplot2->SetLegend("1202A");
$lineplot3->SetLegend("1207");
$lineplot4->SetLegend("1302");
$lineplot5->SetLegend("1408");

// Adjust the legend position
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.4,0.95,"center","bottom");

// Display the graph
$graph->Stroke();
?>